import { createRouter, createWebHashHistory } from 'vue-router';
import layout from '@/pages/layout/index.vue'
import adminRouter from './modules/admin'
import systemRouter from './modules/system'
export const asyncRoutes = [
    adminRouter,
    systemRouter
]
const routes = [
    {
        path: '/',
        component: layout,
        redirect: '/dashboard',
        children: [
            {
                path: 'dashboard',
                name: 'dashboard',
                meta: {
                    title: '仪表盘',
                    icon: 'Odometer'
                },
                component: () => import('@/pages/dashboard/index.vue')
            }
        ]
    },
    adminRouter,
    systemRouter,
    {
        path: '/404',
        name: '404',
        meta: {
            hidden: true,
        },

        component: () => import('@/pages/404/index.vue')
    },
    {
        path: '/:catchAll(.*)',
        redirect: '/404',
        meta: {
            hidden: true,
        },
    }
];
const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router;